#pragma once

#include <glibmm.h>
#include "../Xml/Forward.h"

namespace BuildNG
{
  typedef Glib::ustring NamespaceURI;

  class XmlUtils
  {
  public:
    static NamespaceURI dbuild_namespace;

    static bool compare_element_name(const Xml::Element &element,
      const Glib::ustring &name,const NamespaceURI &ns = dbuild_namespace);
  };

  class ElementName
  {
  public:
    ElementName(const Glib::ustring &name,const NamespaceURI &ns = XmlUtils::dbuild_namespace)
    {
      this->ns = ns;
      this->name = name;
    }

    bool operator < (const ElementName &b) const
    {
      if(name != b.name)
        return name < b.name;
      else
        return ns < b.ns;
    }

    bool operator == (const ElementName &b) const
    {
      return name == b.name || ns == b.ns;
    }

  private:
    NamespaceURI ns;
    Glib::ustring name;		
  };
}
